<?


class Qi_Form_Field_RadioGroup extends Qi_Form_Field
{
	protected $inline = false;
	public $type = null;
	protected $opcoes = array();

	public function __construct($opcoes, $ini = array())
	{
			$this->opcoes = $opcoes;
			parent::__construct($ini);
	}

	public function render()
	{
		return $this->gerar_conteudo_tag();
	}

	protected function gerar_conteudo_tag()
	{
		$htm = "\n";
		foreach($this->opcoes as $value => $label):
			$value = h($value);
			$label = r($label);
			$checked = c($this->value, $value);
			$htm .= <<<OPT
<label><input name="$this->name" type="radio" value="$value"$checked />$label</label>

OPT;
		endforeach;
		return $htm;
	}
}

?>